home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.6 KB  |  209 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Processes;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PROCESSES__}
  27. {$SETC __PROCESSES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ProcessesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __EVENTS__}
  37. {$I Events.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __FILES__}
  40. {$I Files.p}
  41. {$ENDC}
  42.  
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. { type for unique process identifier }
  49.  
  50. TYPE
  51.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  52.     ProcessSerialNumber = RECORD
  53.         highLongOfPSN:            UInt32;
  54.         lowLongOfPSN:            UInt32;
  55.     END;
  56.  
  57.  
  58. CONST
  59.                                                                 {  Process identifier - Various reserved process serial numbers  }
  60.     kNoProcess                    = 0;
  61.     kSystemProcess                = 1;
  62.     kCurrentProcess                = 2;
  63.  
  64. { Definition of the parameter block passed to _Launch }
  65. {  Typedef and flags for launchControlFlags field }
  66.  
  67. TYPE
  68.     LaunchFlags                            = UInt16;
  69.  
  70. CONST
  71.     launchContinue                = $4000;
  72.     launchNoFileFlags            = $0800;
  73.     launchUseMinimum            = $0400;
  74.     launchDontSwitch            = $0200;
  75.     launchAllow24Bit            = $0100;
  76.     launchInhibitDaemon            = $0080;
  77.  
  78. { Format for first AppleEvent to pass to new process.  The size of the overall
  79.   buffer variable: the message body immediately follows the messageLength }
  80.  
  81. TYPE
  82.     AppParametersPtr = ^AppParameters;
  83.     AppParameters = RECORD
  84.         theMsgEvent:            EventRecord;
  85.         eventRefCon:            UInt32;
  86.         messageLength:            UInt32;
  87.     END;
  88.  
  89. { Parameter block to _Launch }
  90.     LaunchParamBlockRecPtr = ^LaunchParamBlockRec;
  91.     LaunchParamBlockRec = RECORD
  92.         reserved1:                UInt32;
  93.         reserved2:                UInt16;
  94.         launchBlockID:            UInt16;
  95.         launchEPBLength:        UInt32;
  96.         launchFileFlags:        UInt16;
  97.         launchControlFlags:        LaunchFlags;
  98.         launchAppSpec:            FSSpecPtr;
  99.         launchProcessSN:        ProcessSerialNumber;
  100.         launchPreferredSize:    UInt32;
  101.         launchMinimumSize:        UInt32;
  102.         launchAvailableSize:    UInt32;
  103.         launchAppParameters:    AppParametersPtr;
  104.     END;
  105.  
  106.     LaunchPBPtr                            = ^LaunchParamBlockRec;
  107. { Set launchBlockID to extendedBlock to specify that extensions exist.
  108.  Set launchEPBLength to extendedBlockLen for compatibility.}
  109.  
  110. CONST
  111.     extendedBlock                = $4C43;                        {  'LC'  }
  112.     extendedBlockLen            = 32;
  113.  
  114.                                                                 {  Definition of the information block returned by GetProcessInformation  }
  115.     modeLaunchDontSwitch        = $00040000;
  116.     modeDeskAccessory            = $00020000;
  117.     modeMultiLaunch                = $00010000;
  118.     modeNeedSuspendResume        = $00004000;
  119.     modeCanBackground            = $00001000;
  120.     modeDoesActivateOnFGSwitch    = $00000800;
  121.     modeOnlyBackground            = $00000400;
  122.     modeGetFrontClicks            = $00000200;
  123.     modeGetAppDiedMsg            = $00000100;
  124.     mode32BitCompatible            = $00000080;
  125.     modeHighLevelEventAware        = $00000040;
  126.     modeLocalAndRemoteHLEvents    = $00000020;
  127.     modeStationeryAware            = $00000010;
  128.     modeUseTextEditServices        = $00000008;
  129.     modeDisplayManagerAware        = $00000004;
  130.     modeGuardPageAware            = $00000002;
  131.  
  132. { Record returned by GetProcessInformation }
  133.  
  134. TYPE
  135.     ProcessInfoRecPtr = ^ProcessInfoRec;
  136.     ProcessInfoRec = RECORD
  137.         processInfoLength:        UInt32;
  138.         processName:            StringPtr;
  139.         processNumber:            ProcessSerialNumber;
  140.         processType:            UInt32;
  141.         processSignature:        OSType;
  142.         processMode:            UInt32;
  143.         processLocation:        Ptr;
  144.         processSize:            UInt32;
  145.         processFreeMem:            UInt32;
  146.         processLauncher:        ProcessSerialNumber;
  147.         processLaunchDate:        UInt32;
  148.         processActiveTime:        UInt32;
  149.         processAppSpec:            FSSpecPtr;
  150.     END;
  151.  
  152. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  153.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  154.     INLINE $205F, $A9F2, $3E80;
  155.     {$ENDC}
  156. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: Str255): OSErr;
  157.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  158.     INLINE $3F3C, $0036, $A88F;
  159.     {$ENDC}
  160. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  162.     INLINE $3F3C, $0037, $A88F;
  163.     {$ENDC}
  164. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  166.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  167.     {$ENDC}
  168. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  170.     INLINE $3F3C, $0038, $A88F;
  171.     {$ENDC}
  172. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  173.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  174.     INLINE $3F3C, $003A, $A88F;
  175.     {$ENDC}
  176. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  178.     INLINE $3F3C, $003B, $A88F;
  179.     {$ENDC}
  180. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  181.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  182.     INLINE $3F3C, $003C, $A88F;
  183.     {$ENDC}
  184. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  185.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  186.     INLINE $3F3C, $003D, $A88F;
  187.     {$ENDC}
  188. {$IFC NOT OLDROUTINELOCATIONS }
  189. {
  190.     ExitToShell was previously in SegLoad.h
  191. }
  192. PROCEDURE ExitToShell;
  193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  194.     INLINE $A9F4;
  195.     {$ENDC}
  196. {$ENDC}
  197.  
  198.  
  199. {$ALIGN RESET}
  200. {$POP}
  201.  
  202. {$SETC UsingIncludes := ProcessesIncludes}
  203.  
  204. {$ENDC} {__PROCESSES__}
  205.  
  206. {$IFC NOT UsingIncludes}
  207.  END.
  208. {$ENDC}
  209.